const mongoose = require("mongoose");

const config = require("../config");

mongoose.connect(config.url, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
});
mongoose.connection.on("connected", () => {
  console.log("连接成功");
});
mongoose.connection.on("disconnected", () => {
  console.log("连接断开");
});
mongoose.connection.on("error", () => {
  console.log("连接失败");
});
module.exports = mongoose;
